﻿using Fozzy;
using Fozzy.Family;
using Fozzy.Skin;
using Fozzy.Space;
using Fozzy.Time;
using System;

namespace Microsoft.FamilyShow
{
    /// <summary>
    /// A Selection is specific, in the sens that it manipulates a criteria
    /// applied on a specific property of a IConcept
    /// </summary>
    /// <typeparam name="result"></typeparam>
    /// <typeparam name="criteria"></typeparam>
    public class  Filter2                            :  Filter<Person2>
    {
        #region Declarations
        #endregion

        #region States
        #endregion

        #region Properties
            private Year Year                       { get { return new Year     (Name)                                                          ; } }
            private Month Month                     { get { return new Month    (Name)                                                          ; } }
            private Day   Day                       { get { return new Day      (Name)                                                          ; } }
            private Place Place                     { get { return new Place    (Name)                                                          ; } }
        #endregion

        #region Constructeurs
            public Filter2(string text, System.Windows.Threading.Dispatcher dispatcher, Predicate<object> predicate) 
                                                    : base(text, dispatcher, predicate)
            {}
        #endregion

            public override bool Match(Person2 person, Fozzy.Object.manner howTo)
            {
                switch (howTo)
    	        {
                    case Fozzy.Object.manner.Deep:
                        return new Deep(person).Matching                    ;
                    case Fozzy.Object.manner.Normal:
                        return new Normal(person).Matching                  ;
                    case Fozzy.Object.manner.Shallow:
                        return new Shallow(person).Matching                 ;    
                    default:
                        return false                                        ;
	            }
            }
    }
}
